<?php
/**
 * @copyright
 * @author :
 * @version :
 * @name :
 * @todo:
*/
class VimuaMarquee extends CModule{
	var $items;

	function init() {
		$time = time();
		$condition = EAnd(EEqual('region','marquee_textlink'),ELTE('start_time',$time),EGTE('end_time',$time));
		$this->items = CTable('banner')->select_all( $condition, array('order_by' => 'position asc', 'items_per_page' => 3) );
		foreach ($this->items as &$item) {
			$item['src'] = stripslashes($item['src']);
		}
	}

	function getCacheName() {
		return  parent::getCacheName().CPortal::$estore_id;
	}

	function draw() {
		if (isset($this->items)){
			CForm($this->path().'/layout.tpl')->parse(array(
				'items' => $this->items,
			));
		}
 	}
}
?>